﻿using UnityEngine;
using System.Collections;

public class Level_Menu_Button : MonoBehaviour {

	public float guiPlacementY;
	public float guiPlacementX;
	public float boxWidth;
	public float boxHeight;

	public float guiPlacementY2;
	public float guiPlacementX2;
	public float boxWidth2;
	public float boxHeight2;
	
	public float guiPlacementY3;
	public float guiPlacementX3;
	public float boxWidth3;
	public float boxHeight3;

	private string difficulty;

	void Update()
	{
		difficulty = DifficultyManager.instance.CheckLevel();
	}

	private void OnGUI()
	{
		if (GUI.Button (new Rect (Screen.width * guiPlacementX, Screen.height * guiPlacementY, Screen.width * boxWidth, Screen.height * boxHeight), "Again!\nYour time: " + (int)HUDManager.instance.finishTime + " seconds"))
		{
			Application.LoadLevel("Main");
		}

		if (GUI.Button (new Rect (Screen.width * guiPlacementX2, Screen.height * guiPlacementY2, Screen.width * boxWidth2, Screen.height * boxHeight2), "Difficulty: " + difficulty))
		{
			DifficultyManager.instance.ChangeLevel();
		}

		if (GUI.Button (new Rect (Screen.width * guiPlacementX3, Screen.height * guiPlacementY3, Screen.width * boxWidth3, Screen.height * boxHeight3), "Back to Menu"))
		{
			Application.LoadLevel("Menu");
		}
	}
}
